package factorialSum;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner reader=new Scanner(System.in);
        int n=reader.nextInt();
        if(n>10){
            System.out.println("invalid inout");
            return;
        }
        int sum=0;
        int factorial;
        for(int i=1;i<=n;i++){
            factorial=1;
            for(int j=1;j<=i;j++){
                factorial*=j;
            }
            sum+=factorial;
        }
        System.out.println(sum);
    }
}